package com.derbysoft.nuke.configkeeper.repository;

import com.derbysoft.nuke.configkeeper.domain.Config;
import com.derbysoft.nuke.configkeeper.domain.ConfigHistory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MockConfigRepository implements ConfigRepository {

    @Override
    public List<String> getSources() {
        List<String> sources = new ArrayList<>();
        sources.add("SOURCE.1");
        sources.add("SOURCE.2");
        return sources;
    }

    @Override
    public void save(Config config) {

    }

    @Override
    public void saveHistory(ConfigHistory configHistory) {

    }

    @Override
    public Config get(String source) {
        Config config1 = Config.builder().build();
        config1.setSource("SOURCE.1");
        Map<String, String> configs = new HashMap<>();
        configs.put("key1", "value1");
        configs.put("key2", "value2");
        config1.setConfigs(configs);
        config1.setTimestamp(System.currentTimeMillis());
        return config1;
    }

    @Override
    public List<ConfigHistory> findHistory(String source, Long timestamp) {
        return null;
    }


}
